home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / ext / standard / php_string.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-26  |  4.8 KB  |  143 lines

  1. /* 
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
  16.    |          Stig Sæther Bakken <ssb@guardian.no>                        |
  17.    +----------------------------------------------------------------------+
  18. */
  19.  
  20. /* $Id: php_string.h,v 1.36 2001/02/26 06:07:23 andi Exp $ */
  21.  
  22. /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
  23.  
  24. #ifndef PHP_STRING_H
  25. #define PHP_STRING_H
  26.  
  27. PHP_FUNCTION(strspn);
  28. PHP_FUNCTION(strcspn);
  29. PHP_FUNCTION(str_replace);
  30. PHP_FUNCTION(chop);
  31. PHP_FUNCTION(trim);
  32. PHP_FUNCTION(ltrim);
  33. PHP_FUNCTION(soundex);
  34. PHP_FUNCTION(levenshtein);
  35.  
  36. PHP_FUNCTION(count_chars);
  37. PHP_FUNCTION(wordwrap);
  38. PHP_FUNCTION(explode);
  39. PHP_FUNCTION(implode);
  40. PHP_FUNCTION(strtok);
  41. PHP_FUNCTION(strtoupper);
  42. PHP_FUNCTION(strtolower);
  43. PHP_FUNCTION(basename);
  44. PHP_FUNCTION(dirname);
  45. PHP_FUNCTION(pathinfo);
  46. PHP_FUNCTION(strstr);
  47. PHP_FUNCTION(strpos);
  48. PHP_FUNCTION(strrpos);
  49. PHP_FUNCTION(strrchr);
  50. PHP_FUNCTION(substr);
  51. PHP_FUNCTION(quotemeta);
  52. PHP_FUNCTION(ucfirst);
  53. PHP_FUNCTION(ucwords);
  54. PHP_FUNCTION(strtr);
  55. PHP_FUNCTION(strrev);
  56. PHP_FUNCTION(hebrev);
  57. PHP_FUNCTION(hebrevc);
  58. PHP_FUNCTION(user_sprintf);
  59. PHP_FUNCTION(user_printf);
  60. PHP_FUNCTION(addcslashes);
  61. PHP_FUNCTION(addslashes);
  62. PHP_FUNCTION(stripcslashes);
  63. PHP_FUNCTION(stripslashes);
  64. PHP_FUNCTION(chr);
  65. PHP_FUNCTION(ord);
  66. PHP_FUNCTION(nl2br);
  67. PHP_FUNCTION(setlocale);
  68. PHP_FUNCTION(localeconv);
  69. PHP_FUNCTION(stristr);
  70. PHP_FUNCTION(chunk_split);
  71. PHP_FUNCTION(parse_str);
  72. PHP_FUNCTION(bin2hex);
  73. PHP_FUNCTION(similar_text);
  74. PHP_FUNCTION(strip_tags);
  75. PHP_FUNCTION(str_repeat);
  76. PHP_FUNCTION(substr_replace);
  77. PHP_FUNCTION(strnatcmp);
  78. PHP_FUNCTION(strnatcasecmp);
  79. PHP_FUNCTION(substr_count);
  80. PHP_FUNCTION(str_pad);
  81. PHP_FUNCTION(sscanf);
  82. #ifdef HAVE_STRCOLL
  83. PHP_FUNCTION(strcoll);
  84. #endif
  85.  
  86.  
  87. #if defined(HAVE_LOCALECONV) && defined(ZTS)
  88. PHP_MINIT_FUNCTION(localeconv);
  89. PHP_MSHUTDOWN_FUNCTION(localeconv);
  90. #endif
  91.  
  92. #define strnatcmp(a, b) \
  93.     strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
  94. #define strnatcasecmp(a, b) \
  95.     strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
  96. PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
  97.  
  98. PHPAPI char *php_strtoupper(char *s, size_t len);
  99. PHPAPI char *php_strtolower(char *s, size_t len);
  100. PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
  101. PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit);
  102. PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength);
  103. PHPAPI void php_stripslashes(char *str, int *len);
  104. PHPAPI void php_stripcslashes(char *str, int *len);
  105. PHPAPI char *php_basename(char *str, size_t  len);
  106. PHPAPI void php_dirname(char *str, int len);
  107. PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
  108. PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
  109.         int needle_len, char *str, int str_len, int *_new_length);
  110. PHPAPI void php_trim(pval *str, pval *return_value, int mode);
  111. PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allow_len);
  112.  
  113. PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result);
  114.  
  115. PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value);
  116. PHPAPI void php_explode(pval *delim, pval *str, pval *return_value, int limit);
  117.  
  118. static inline char *
  119. php_memnstr(char *haystack, char *needle, int needle_len, char *end)
  120. {
  121.     char *p = haystack;
  122.     char *s = NULL;
  123.  
  124.     for(; p <= end - needle_len && 
  125.             (s = memchr(p, *needle, end - p - needle_len + 1)); p = s + 1) {
  126.         if(memcmp(s, needle, needle_len) == 0)
  127.             return s;
  128.     }
  129.     return NULL;
  130. }
  131.  
  132. PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); 
  133. PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end); 
  134.  
  135. #ifndef HAVE_STRERROR
  136. PHPAPI char *php_strerror(int errnum);
  137. #define strerror php_strerror
  138. #endif
  139.  
  140. void register_string_constants(INIT_FUNC_ARGS);
  141.  
  142. #endif /* PHP_STRING_H */
  143.